﻿@model MVC.Models.Foto

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Foto</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.Path)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Path)
            @Html.ValidationMessageFor(model => model.Path)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Descricao)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Descricao)
            @Html.ValidationMessageFor(model => model.Descricao)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DataFoto)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DataFoto)
            @Html.ValidationMessageFor(model => model.DataFoto)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sala.SalaId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sala.SalaId)
            @Html.ValidationMessageFor(model => model.Sala.SalaId)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Crianca.CriancaId)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Crianca.CriancaId)
            @Html.ValidationMessageFor(model => model.Crianca.CriancaId)
        </div>

        <p>
            <input type="submit" value="Create" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>

<h3> Testes futuros : upload de ficheiros (vai para a pasta /assets/)</h3>

@using (Html.BeginForm("Index", "EditFotos", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <input type="file" name="file" />
    <input type="submit" value="OK" />
}

